import pandas as pd
from sklearn.neighbors import KNeighborsRegressor


data = pd.read_csv('GDP.csv')
year = data.loc[::-1, 'Year'].to_numpy().reshape(-1,1)
gdp = data.loc[::-1, 'Jiangsu'].to_numpy()
print(year)
print(gdp)
model1 = KNeighborsRegressor()
model1.fit(year, gdp)
print(model1.predict([[2021]]))
